<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title><?php echo C('WEB_TITLE');?></title>

		<link rel="stylesheet" type="text/css" href="/Public/css/common.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/js/layui/css/layui.css" media="all"/>

		<link rel="stylesheet" href="/Public/js/datepicker/datepicker.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/index.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/style.css"/>

		<link rel="stylesheet" href="<?php echo C('PC_ICON_HTTP');?>">

		<script type="text/javascript" >

			const moduleName = "<?php echo (MODULE_NAME); ?>";

		</script>

        <link rel="stylesheet" href="/Public/js/viewer/css/viewer.min.css">
		
		<link rel="stylesheet" type="text/css" href="/Public/js/select2/select2.css" media="all"/>

		<script type="text/javascript" src="/Public/js/jquery-1.9.1.min.js"></script>
		
		<script type="text/javascript" src="/Public/js/jquery-ui.min.js"></script>

		<script type="text/javascript" src="/Public/js/cookie/jquery.cookie.js"></script>

		<script type="text/javascript" src="/Public/js/lang/<?php echo (getStrToLower(cookie('think_language'))); ?>.js"></script>

		<script type="text/javascript" src="/Public/js/colorpicker.js"></script>

		<script type="text/javascript" src="/Public/js/layer/layer.js"></script>

		<script type="text/javascript" src="/Public/js/layui/layui.js"></script>

        <script type="text/javascript" src="/Public/js/feeldesk.js"></script>

        <script type="text/javascript" src="/Public/crm/js/index.js"></script>

        <script type="text/javascript" src="/Public/js/jquery.nicescroll.js"></script>

		<script type="text/javascript" src="/Public/js/clipboard.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/select2.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/jquery.core.js"></script>

	</head>

<body>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.all.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/moment.min.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.en.js"></script>

    <div class="fd-right-main">

        

	<div class="hidden hg100 layui-form" id="Memberlist">

	<div class="feeldesk-form pd0 feelcrm-form">

		<div class="layui-tab">

			<ul class="layui-tab-title">

				<li class="tab-title-name"><?php echo L('USER_LIST');?></li>

				<li class="tab-title-btn">

					<a href="javascript:void(0);" id="memberDetailLay" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

					<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

					<div class="clear"></div>

				</li>

				<form1 action="" class="fr selectMemberForm" method="get">

					<div class="compact-search">

						<i class="iconfont icon-search"></i>

						<input type="text" name="selectMemberKeyword" value="" placeholder="<?php echo L('NAME1');?>/<?php echo L('CELL_PHONE');?>"/>

						<a href="javascript:" class="selectMemberBtn"><?php echo L('SEARCH');?></a>

					</div>

				</form1>

			</ul>

		</div>

	</div>

	<div class="feelcrm-list">

		<table class="layui-table" lay-skin="line">

			<thead>

				<tr>

					<th></th><th><?php echo L('NAME');?></th><th><?php echo L('EMAIL');?></th><th><?php echo L('MOBILE');?></th><th><?php echo L('SUBORDINATE_SECTOR');?></th><th><?php echo L('ROLE');?></th>

				</tr>

			</thead>

			<tbody id="member-detail">

				<?php if(empty($member)): ?><tr class="nodata center">

						<td colspan="11">

							<p><i class="iconfont icon-nothing fts20"></i></p>

							<p><?php echo L('NO_DATA');?></p>

						</td>

					</tr>

				<?php else: ?>

					<?php if(is_array($member)): $i = 0; $__LIST__ = $member;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

							<td><input type="radio" value="<?php echo encrypt($vo['member_id'],'MEMBER');?>" name="member" lay-skin="primary" /></td>

							<td><?php echo ($vo["name"]); ?></td>

							<td><?php echo ($vo["email"]); ?></td>

							<td><?php echo ($vo["mobile"]); ?></td>

							<td><?php echo CrmgetMemberGroupName($groupList,$vo['group_id']);?></td>

							<td><?php echo ($roleList[$vo['role_id']]['role_name']); ?></td>

						</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

			</tbody>

		</table>

		<div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($memberPage); ?></div></div>

	</div>

</div>

<script>

	$('input[name="selectMemberKeyword"]').unbind('keyup').keyup(function (e)
	{
		e.stopPropagation();

		if (e.keyCode == 13)
		{
			searchSelectMemberList();

			return false;
		}
	});

	$('.selectMemberBtn').unbind('click').bind('click',function(){

		searchSelectMemberList();

		return false;
	})

	function searchSelectMemberList()
	{
		var keyword = $('input[name="selectMemberKeyword"]').val();

		$.ajax({
			url:"<?php echo U('AjaxRequest/getMemberList');?>",
			type:'get',
			data:{'sMemberKeyword':keyword},
			async: false,
			datatype:'json',
			success:function(data)
			{

				$('#member-detail').html(data.html);

				$('#Memberlist .feeldesk-page').html(data.page);

				layui.use('form', function() {

					var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

					form.render();

				});

				$('#Memberlist .feeldesk-page a').click(function()
				{
					pageclick(this);

					return false;
				})

			},
			error:function()
			{
				layer.msg("<?php echo L('FAILED_TO_ACQUIRE_USER');?>");
			}
		});
	}

</script>


	<script>

		$(function(){

			$('#Memberlist .feeldesk-page a').click(function(){

				pageclick(this,'/Customer/detail');

				return false;
			})

		})

	</script>

	<div class="hidden hg100 div-layerframe feeldesk-form layui-form" id="abandonCust">

	<div class="feeldesk-form pd0 feelcrm-form">

		<div class="layui-tab">

			<ul class="layui-tab-title">

				<li class="tab-title-name"><?php echo L('CHOOSE_GIVE_UP_REASON');?></li>

				<li class="tab-title-btn">

					<?php if((CONTROLLER_NAME) == "Customer"): if(!empty($customer["customer_id"])): ?><a href="javascript:abandonOperate('<?php echo U('customer/toPool');?>','<?php echo L('GIVE_UP');?>','<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

							<?php else: ?>

							<a href="javascript:abandonOperate('<?php echo U('customer/toPool');?>','<?php echo L('GIVE_UP');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a><?php endif; ?>

					<?php else: ?>

						<?php if(!empty($clue["clue_id"])): ?><a href="javascript:abandonOperate('<?php echo U('clue/toPool');?>','<?php echo L('GIVE_UP');?>','<?php echo encrypt($clue['clue_id'],'CLUE');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

							<?php else: ?>

							<a href="javascript:abandonOperate('<?php echo U('clue/toPool');?>','<?php echo L('GIVE_UP');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a><?php endif; endif; ?>

					<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

					<div class="clear"></div>

				</li>

			</ul>

		</div>

	</div>

	<div class="form-content">

		<div class="form-item pb25 pt50 create-both-end">

			<div class="layui-form-item">

				<label class="layui-form-label">

				   <?php echo L('REASON_FOR_GIVING_UP');?>

				</label>

				<div class="layui-input-inline">

					<select name="abandon_id" id="abandon_id" lay-ignore >

						<option value=""><?php echo L('CHOOSE_GIVE_UP_REASON');?></option>

						<?php if(is_array($abandons)): $i = 0; $__LIST__ = $abandons;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["abandon_id"]); ?>" title="<?php echo ($v["abandon_name"]); ?>"><?php echo ($v["abandon_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

					</select>

					<script>

						$("#abandon_id").select2();

					</script>

				</div>

				<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

			</div>

			<div class="layui-form-item layui-form-item-remark">

				<label class="layui-form-label"><?php echo L('REMARKS');?>：</label>

				<div class="layui-input-inline" style="line-height: 32px">

					<?php if((CONTROLLER_NAME) == "Customer"): echo L('GIVE_UP_REMARK',['name'=>L('CUSTOMER')]);?>

					<?php else: ?>

						<?php echo L('GIVE_UP_REMARK',['name'=>L('CLUE')]); endif; ?>

				</div>

			</div>

		</div>

	</div>

</div>


	<div class="comment-shade"></div>

	<div class="comment-panel hidden" id="comment">

		<header><span><?php echo L('COMMENT');?></span><i class="iconfont icon-guanbi comment-close" title="<?php echo L('CLOSE');?>"></i></header>

		<form action="<?php echo U('commentFollow');?>" id="commentForm" class="layui-form">

			<input type="hidden" name="comment[follow_id]" id="commentFollowId"/>

			<textarea id='commentEditor' name="comment[content]" cols="30" rows="10" placeholder="<?php echo L('ENTER_COMMENT_CONTENT');?>"></textarea>

			<div class="submit-comment"><a href="javascript:" class="layui-btn"><?php echo L('SUBMIT');?></a></div>

		</form>

	</div>


	<div class="hidden hg100 div-layerframe feeldesk-form layui-form" id="LoseCust">

		<div class="feeldesk-form pd0 feelcrm-form">

			<div class="layui-tab">

				<ul class="layui-tab-title">

					<li class="tab-title-name"><?php echo L('CUSTOMER_LOST_ORDER');?></li>

					<li class="tab-title-btn">

						<a href="javascript:loseCustomer('<?php echo U('customer/lose');?>','<?php echo L('LOST_ORDER');?>','<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

						<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

						<div class="clear"></div>

					</li>

				</ul>

			</div>

		</div>

		<div class="form-content">

			<div class="form-item pb25 pt50 create-both-end">

				<div class="layui-form-item">

					<label class="layui-form-label">

						<?php echo L('REASON_FOR_LOSS');?>

					</label>

					<div class="layui-input-inline">

						<select name="lose_id" id="lose_id" lay-ignore>

							<option value=""><?php echo L('REASON_FOR_LOSS');?></option>

							<?php if(is_array($loses)): $i = 0; $__LIST__ = $loses;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["lose_id"]); ?>" title="<?php echo ($v["lose_name"]); ?>"><?php echo ($v["lose_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

						</select>

						<script>

							$("#lose_id").select2();

						</script>

					</div>

					<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

				</div>

				<div class="layui-form-item">

					<label class="layui-form-label">

						<?php echo L('COMPETITOR');?>

					</label>

					<div class="layui-input-inline">

						<select name="competitor_id" id="competitor_id" lay-ignore>

							<option value=""><?php echo L('CHOOSE'); echo L('COMPETITOR');?></option>

							<?php if(is_array($competitor)): $i = 0; $__LIST__ = $competitor;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["competitor_id"]); ?>" title="<?php echo ($v["detail"]["name"]); ?>"><?php echo ($v["detail"]["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

						</select>

						<script>

							$("#competitor_id").select2();

						</script>

					</div>

					<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

				</div>

				<div class="layui-form-item">

					<label class="layui-form-label">

						<?php echo L('PUT_CUSTOMER_POOL');?>

					</label>

					<div class="layui-input-inline">

						<input type="checkbox" name="lose_closed" id="lose_closed" lay-skin="switch" value="1" >

					</div>

				</div>

			</div>

		</div>

	</div>

	<div class="customer-detail feeldesk-form pd0 feelcrm-form">

		<div class="customer-detail-content">

			<div class="detail-sidebar sidebar" id="closeCustomerDetail"><i class="iconfont icon-right"></i></div>

			<div class="customer-header h-auto">

				<div class="customer-header-name"><?php echo ($customer["detail"]["name"]); ?></div>

				<div class="customer-header-right">

					<?php if(in_array(($detailtype), explode(',',"index,analysis"))): if(($customer["isvalid"]) == "1"): if($customer['member_id'] > 0): if(!empty($isLoseCustomerAuth)): if(($customer["is_losed"]) != "1"): if(($customer["is_trade"]) != "1"): ?><a href="javascript:" class="feelcrm-commbtn ml5" data-id="<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>" data-href="<?php echo U('Customer/lose');?>" data-name="<?php echo L('LOST_ORDER');?>" id="loseCustomer"><?php echo L('LOST_ORDER');?></a><?php endif; endif; endif; ?>

								<?php if(!empty($istransferCustomerAuth)): ?><a href="javascript:" class="chooseMemberDetail feelcrm-commbtn ml5" data-id="<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>" data-href="<?php echo U('Customer/transfer');?>" data-name="<?php echo L('TRANSFER');?>" id="transferCustomer"><?php echo L('TRANSFER');?></a><?php endif; ?>

								<?php if(!empty($istoPoolCustomerAuth)): ?><a href="javascript:" class="feelcrm-commbtn ml5" data-id="<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>" data-href="<?php echo U('Customer/toPool');?>" data-name="<?php echo L('GIVE_UP_CUSTOMERS');?>" id="toPoolCustomer"><?php echo L('GIVE_UP');?></a><?php endif; ?>

								<?php echo FEELCRM('Customer/delete',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'type'=>encrypt('index','CUSTOMER')],L('DELETE'),'feelcrm-commbtn ml5','trash');?>

								<?php else: ?>

								<?php if(!empty($isDrawCustomerAuth)): ?><a href="javascript:" class="feelcrm-commbtn ml5" data-id="<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>" data-href="<?php echo U('Customer/draw');?>" data-name="<?php echo L('RECEIVE');?>" id="drawCustomer"><?php echo L('RECEIVE');?></a><?php endif; ?>

								<?php if(!empty($isAllotCustomerAuth)): ?><a href="javascript:" class="chooseMemberDetail feelcrm-commbtn ml5" data-id="<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>" data-href="<?php echo U('Customer/allot');?>" data-name="<?php echo L('DISTRIBUTION');?>" id="allotCustomer"><?php echo L('DISTRIBUTION');?></a><?php endif; ?>

								<?php if(!empty($isLoseCustomerAuth)): if(($customer["is_losed"]) != "1"): ?><a href="javascript:" class="feelcrm-commbtn ml5" data-id="<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>" data-href="<?php echo U('Customer/lose');?>" data-name="<?php echo L('LOST_ORDER');?>" id="loseCustomer"><?php echo L('LOST_ORDER');?></a><?php endif; endif; ?>

								<?php echo FEELCRM('Customer/delete',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'type'=>encrypt('pool','CUSTOMER')],L('DELETE'),'feelcrm-commbtn ml5','trash'); endif; ?>

						<?php else: ?>

							<?php echo FEELCRM('Recover/re_customer',['id'=>encrypt($customer['customer_id'],'CUSTOMER')],L('RECOVERY'),'feelcrm-commbtn ml5','batch');?>

							<?php echo FEELCRM('Customer/delete',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'type'=>encrypt('index','CUSTOMER')],L('DELETE'),'feelcrm-commbtn ml5','trash'); endif; endif; ?>

					<?php if(($customer["isvalid"]) == "1"): if(($detailtype) == "contacter"): echo FEELCRM('Customer/create_contacter',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('contacter','CUSTOMER')],L('ADD_CONTACTS'),'feelcrm-commbtn'); endif; ?>

						<?php if(($detailtype) == "opportunity"): if($customer['member_id'] > 0): echo FEELCRM('Opportunity/create',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('opportunity','CUSTOMER')],L('ADD_OPPORTUNITY'),'feelcrm-commbtn'); endif; endif; ?>

						<?php if(($detailtype) == "contract"): echo FEELCRM('Contract/create',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('contract','CUSTOMER')],L('ADD_CONTRACT'),'feelcrm-commbtn'); endif; endif; ?>

				</div>

				<div class="clear"></div>

				<div class="customer-system-info">

					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('SUBORDINATE_SECTOR');?></p><p class="system-nav-con"><?php echo CrmgetMemberGroupName($groupList,$customer['group_id']);?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('LEADER');?></p><p class="system-nav-con blue8"><?php echo ((isset($customer["member_name"]) && ($customer["member_name"] !== ""))?($customer["member_name"]):'<span class="iconfont icon-nothing gray1"></span>'); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('FINAL_FOLLOW-UP');?></p><p class="system-nav-con"><?php echo (getDates($customer["lastfollowtime"])); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('NEXT_CONTACT_TIME');?></p><p class="system-nav-con"><?php echo (getDates($customer["nextcontacttime"])); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('CREATE_TIME');?></p><p class="system-nav-con"><?php echo (getDates($customer["createtime"])); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('FOUNDER');?></p><p class="system-nav-con"><?php echo getCustomerCreateName($customer['creater_id'],$customer['creater_name']);?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('INFORMATION_COMPLETENESS');?></p><p class="system-nav-con"><?php echo ($customer["percent"]); ?></p></div>
					<!--<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('IS_LOSE_ORDER');?></p><p class="system-nav-con"><?php if(($customer["is_losed"]) == "1"): ?><span class="red1"><?php echo L('YES');?></span><?php else: ?><span class="green4"><?php echo L('NO');?></span><?php endif; ?></p></div>-->
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('ENTRY_METHOD');?></p><p class="system-nav-con"><?php echo getCrmEntryMethod($customer['entry_method']);?></p></div>

				</div>

				<div class="clear"></div>

			</div>

			<div class="form-nav" id="detail-nav">

				<ul>

					<?php if(!empty($isDetailAuthView)): ?><li><a href="<?php echo U('customer/detail',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('index','CUSTOMER'),'detail_source'=>$detail_source]);?>" class="form-tab <?php if(in_array(($detailtype), explode(',',"index,follow,analysis"))): ?>active<?php endif; ?>"><?php echo L('CUSTOMER_DETAIL');?></a></li><?php endif; ?>

					<?php if(($customer["isvalid"]) == "1"): if(!empty($isContacterAuthView)): ?><li><a href="<?php echo U('customer/detail',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('contacter','CUSTOMER'),'detail_source'=>$detail_source]);?>" class="form-tab <?php if(($detailtype) == "contacter"): ?>active<?php endif; ?>"><?php echo L('CONTACT');?>(<?php echo ($contacterCount); ?>)</a></li><?php endif; ?>

						<?php if(!empty($isOpportunityAuthView)): ?><li><a href="<?php echo U('customer/detail',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('opportunity','CUSTOMER'),'detail_source'=>$detail_source]);?>" class="form-tab <?php if(($detailtype) == "opportunity"): ?>active<?php endif; ?>"><?php echo L('OPPORTUNITY');?>(<?php echo ($opportunityCount); ?>)</a></li><?php endif; ?>

						<?php if(!empty($isContractAuthView)): ?><li><a href="<?php echo U('customer/detail',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('contract','CUSTOMER'),'detail_source'=>$detail_source]);?>" class="form-tab <?php if(($detailtype) == "contract"): ?>active<?php endif; ?>"><?php echo L('CONTRACT');?>(<?php echo ($contractCount); ?>)</a></li><?php endif; ?>

						<?php if($crmsite['customerReseller'] == 1): if(!empty($isShipmentAuthView)): if(($customer["customer_type"]) == "agent"): ?><!--<li><a href="<?php echo U('customer/detail',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('shipment','CUSTOMER'),'detail_source'=>$detail_source]);?>" class="form-tab <?php if(($detailtype) == "shipment"): ?>active<?php endif; ?>"><?php echo L('INVOICING');?></a></li>--><?php endif; endif; endif; endif; ?>

					<div class="clear"></div>

				</ul>

			</div>

			<!--<?php echo L('CUSTOMER_DETAIL');?>-->
			<!--<form class="layui-form">-->

			<div class="form-content form-content1 relative <?php if(!in_array(($detailtype), explode(',',"index,follow,analysis"))): ?>hidden<?php endif; ?>" style="overflow:inherit">

				<div class="<?php if(!in_array(($detailtype), explode(',',"index,analysis"))): ?>hidden<?php endif; ?>" >

					<div class="form-item pb25 pt10 ">

						<form class="layui-form" action="<?php echo U('customer/edit',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'type'=>encrypt('detail','CUSTOMER'),'detailtype'=>encrypt('index','CUSTOMER')]);?>">

							<?php if(($customer["isvalid"]) == "1"): ?><a href="javascript:" class="feelcrm-commbtn fr edit-customer-detail" ><?php echo L('EDITOR');?></a>

								<a href="javascript:" class="feelcrm-commbtn fr finish-customer-detail" data-no="<?php echo ($customer["customer_prefix"]); echo ($customer["customer_no"]); ?>"><?php echo L('COMPLETE');?></a><?php endif; ?>

							<div class="clear"></div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label"><?php echo L('CUSTOMER_NUMBER');?></label>

								<div class="layui-input-inline"><?php echo ($customer["customer_prefix"]); echo ($customer["customer_no"]); ?></div>

								<div class="clear"></div>

							</div>

							<?php $t = 0; $ft = 0; $reg = 0; ?>



							<?php if(($crmsite["customerReseller"]) == "1"): ?><div class="layui-form-item mb10 wd50 fl">

									<label class="layui-form-label"><?php echo L('CUSTOMER_TYPE');?></label>

									<div class="layui-input-inline <?php if(!empty($isEditCustomerAuth)): ?>pd0 detail-update-form<?php endif; ?>">

										<div class="layui-detail-edit-default" >

											<?php if(($customer["customer_type"]) == "agent"): echo L('DEALER'); else: echo L('ORDINARY_CUSTOMER'); endif; ?>

										</div>

										<?php if(!empty($isEditCustomerAuth)): ?><div class="hidden layui-detail-edit-form">

												<input type="radio" name="customer[customer_type]" <?php if(($customer['customer_type']) == "customer"): ?>checked<?php endif; ?> value="customer" title="<?php echo L('ORDINARY_CUSTOMER');?>" lay-filter="radio-customer-type">

												<input type="radio" name="customer[customer_type]" <?php if(($customer['customer_type']) == "agent"): ?>checked<?php endif; ?> value="agent" title="<?php echo L('DEALER');?>" lay-filter="radio-customer-type">

											</div>

											<i class="i-update-success iconfont icon-system-success hidden"></i><?php endif; ?>

									</div>

									<div class="clear"></div>

								</div><?php endif; ?>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('TRANSACTION_STATUS');?>

								</label>

								<div class="layui-input-inline <?php if(!empty($isEditCustomerAuth)): ?>pd0 detail-update-form<?php endif; ?>">

									<div class="layui-detail-edit-default" >

										<?php if(($customer["is_trade"]) == "1"): ?><span class="blue8"><?php echo L('DEAL_DONE');?></span>

											<?php else: ?>

											<span class="red1"><?php echo L('UNSOLD');?></span><?php endif; ?>

									</div>

									<?php if(!empty($isEditCustomerAuth)): ?><div class="hidden layui-detail-edit-form">

											<?php if(!empty($isUpdateTradeAuth)): ?><input type="radio" name="customer[is_trade]" <?php if(($customer['is_trade']) == "0"): ?>checked<?php endif; ?> value="0" title="<?php echo L('UNSOLD');?>" lay-filter="radio-customer-trade">

												<input type="radio" name="customer[is_trade]" <?php if(($customer['is_trade']) == "1"): ?>checked<?php endif; ?> value="1" title="<?php echo L('DEAL_DONE');?>" lay-filter="radio-customer-trade">

											<?php else: ?>

												<?php if(($customer["is_trade"]) == "1"): ?><span class="blue8"><?php echo L('DEAL_DONE');?></span>

													<?php else: ?>

													<span class="red1"><?php echo L('UNSOLD');?></span><?php endif; endif; ?>

										</div>

										<i class="i-update-success iconfont icon-system-success hidden"></i><?php endif; ?>

								</div>

								<div class="clear"></div>

							</div>

							<?php if(is_array($customerform)): $i = 0; $__LIST__ = $customerform;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
							<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><div class="layui-form-item mb10 wd50 fl">

									<label class="layui-form-label"><?php echo ($vo["form_description"]); ?></label>

									<div class="layui-input-inline <?php if(!empty($isEditCustomerAuth)): ?>pd0 detail-update-form<?php endif; ?>">

										<div class="layui-detail-edit-default" >

											<span class="fl"><?php echo ((isset($customer['detail'][$vo['form_name']]) && ($customer['detail'][$vo['form_name']] !== ""))?($customer['detail'][$vo['form_name']]):'--'); ?></span>

											<!--<?php if($vo['form_name'] == 'phone' && $customer['detail'][$vo['form_name']] && $callcenterAuth == 1): ?><span class="fl icon-onclickcall"><i class="iconfont icon-boda blue8" onclick="OnclickCall(<?php echo ($customer['detail'][$vo['form_name']]); ?>);"></i></span><?php endif; ?>-->

											<?php if($vo['form_name'] == 'phone' && $customer['detail'][$vo['form_name']]): ?><span class="fl icon-onclickcall"><i class="iconfont icon-boda blue8" onclick="CallUp(<?php echo ($customer['detail'][$vo['form_name']]); ?>,4);"></i></span><?php endif; ?>

											<div class="clear"></div>

										</div>

										<?php if(!empty($isEditCustomerAuth)): ?><div class="hidden layui-detail-edit-form">

												<?php if(($vo["form_type"]) == "date"): $ft++; endif; ?>

												<?php if(($vo["form_type"]) == "region"): $reg++; endif; ?>

												<?php $t++; ?>

												<?php echo W('Update/updateFormContent',[$customer,$customer['customer_id'],$vo,'customer',$t,$ft,$reg]);?>

											</div>

											<i class="i-update-success iconfont icon-system-success hidden"></i><?php endif; ?>

									</div>

									<div class="clear"></div>

								</div>

							<?php else: ?>

								<?php if(($vo["form_type"]) == "region"): ?><input type="hidden" name="customer_form[<?php echo ($vo["form_name"]); ?>_defaultCountry]" value="<?php echo ($customer[$vo['form_name']]['defaultCountry']); ?>" >
									<input type="hidden" name="customer_form[<?php echo ($vo["form_name"]); ?>_defaultProv]" value="<?php echo ($customer[$vo['form_name']]['defaultProv']); ?>" >
									<input type="hidden" name="customer_form[<?php echo ($vo["form_name"]); ?>_defaultCity]" value="<?php echo ($customer[$vo['form_name']]['defaultCity']); ?>" >
									<input type="hidden" name="customer_form[<?php echo ($vo["form_name"]); ?>_defaultArea]" value="<?php echo ($customer[$vo['form_name']]['defaultArea']); ?>" >

									<?php else: ?>

									<input type="hidden" name="customer_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($customer['detail'][$vo['form_name']]); ?>" ><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>

							<?php $tx = 0; ?>

							<?php if(is_array($customerform2)): $i = 0; $__LIST__ = $customerform2;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
							<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><div class="layui-form-item mb10 wd100 layui-form-item-textarea fl">

									<label class="layui-form-label">

										<?php echo ($vo["form_description"]); ?>

									</label>

									<div class="layui-input-inline <?php if(!empty($isEditCustomerAuth)): ?>pd0 detail-update-form<?php endif; ?>">

										<div class="layui-detail-edit-default textareaImg">

											<?php echo ((isset($customer['detail'][$vo['form_name']]) && ($customer['detail'][$vo['form_name']] !== ""))?($customer['detail'][$vo['form_name']]):'--'); ?>

										</div>

										<?php if(!empty($isEditCustomerAuth)): $tx++; ?>

											<div class="hidden layui-detail-edit-form">

												<textarea class="layui-textarea layui-hide ticket-textarea" name="customer_form[<?php echo ($vo["form_name"]); ?>]" id="crmEditor<?php echo ($tx); ?>"><?php echo ($customer['detail'][$vo['form_name']]); ?></textarea>


											</div>

											<i class="i-update-success iconfont icon-system-success hidden"></i><?php endif; ?>

									</div>

									<div class="clear"></div>

								</div>
							<?php else: ?>

								<input type="hidden" name="customer_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($customer['detail'][$vo['form_name']]); ?>" ><?php endif; endforeach; endif; else: echo "" ;endif; ?>

							<div class="clear"></div>

						</form>

					</div>

				</div>



				<div class="form-nav pd0" id="customer-detail-nav">

					<ul>

						<?php if(($customer["isvalid"]) == "1"): if(!empty($isFollowAuthView)): ?><li><a href="javascript:void(0);" onclick="switchCustomerContent(this,1)" <?php if(($detailtype) == "index"): ?>class="active"<?php endif; ?>><?php echo L('CONTACT_RECORD');?></a></li><?php endif; ?>

							<?php if($isFollowAuthView || $isContractAuthView): ?><li><a href="javascript:void(0);" onclick="switchCustomerContent(this,9)" ><?php echo L('ATTACHMENT');?></a></li><?php endif; ?>

							<li><a href="javascript:void(0);" onclick="switchCustomerContent(this,4)" <?php if(($detailtype) == "index"): if(empty($isFollowAuthView)): ?>class="active"<?php endif; endif; ?>><?php echo L('OPERATION_RECORD');?></a></li>

							<!--<li><a href="javascript:void(0);" onclick="switchCustomerContent(this,5)" <?php if(($detailtype) == "analysis"): ?>class="active"<?php endif; ?>><?php echo L('CLIENT_ANALYSIS');?></a></li>

							<li><a href="javascript:void(0);" onclick="switchCustomerContent(this,6)"><?php echo L('COMPETITOR');?></a></li>-->

							<?php else: ?>

							<li><a href="javascript:void(0);" onclick="switchCustomerContent(this,4)" class="active"><?php echo L('OPERATION_RECORD');?></a></li><?php endif; ?>

					</ul>

				</div>

				<?php if(($customer["isvalid"]) == "1"): if(!empty($isFollowAuthView)): ?><!--<?php echo L('CONTACT_RECORD');?>-->
						<div class="customerDetailContent <?php if(($detailtype) != "index"): ?>hidden<?php endif; ?>" id="customer-detail-content1">

							<div class="form-content">

								<div class="layui-tab-content pb0 follow-default">

									<div class="layui-tab-item layui-show ">

										<div class="form-item">

											<div class="layui-form-item">

												<div class="layui-input-inline wd100">

													<input type="text" class="layui-input" placeholder="<?php echo L('ADD_CONTACT_RECORD');?>" name="" id="follow-entry">

												</div>

											</div>

										</div>

									</div>

								</div>

								<div class="layui-tab-content pb0 follow-tocreate hidden">

									<form action="<?php echo U('customer/create_follow',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('index','CUSTOMER')]);?>" class="layui-form" method="post" enctype="multipart/form-data">

										<?php echo W('Follow/createFollow');?>

									</form>

								</div>

								<div class="feelcrm-follow-nav" >

									<div class="follow-nav-list active" onclick="switchFollowContent(this,1)"><?php echo L('WHOLE');?></div>
									<div class="follow-nav-list" onclick="switchFollowContent(this,2)"><?php echo L('CUSTOMER');?></div>
									<div class="follow-nav-list" onclick="switchFollowContent(this,3)"><?php echo L('OPPORTUNITY');?></div>
									<div class="follow-nav-list" onclick="switchFollowContent(this,4)"><?php echo L('CLUE');?></div>
									<div class="clear"></div>

								</div>

								<!-- 全部跟进记录 -->
								<div class="feelcrm-follow border-none followContent" id="followContent1">

									<?php echo W('Follow/followList',[$follow,$customer,'customer']);?>

								</div>

								<!--客户联系记录-->
								<div class="feelcrm-follow border-none followContent hidden" id="followContent2">

									<?php echo W('Follow/followList',[$customer_follow,$customer,'customer']);?>

								</div>

								<!--客户联系记录-->
								<div class="feelcrm-follow border-none followContent hidden" id="followContent3">

									<?php echo W('Follow/followList',[$opportunity_follow,$customer,'customer']);?>

								</div>

								<!--客户联系记录-->
								<div class="feelcrm-follow border-none followContent hidden" id="followContent4">

									<?php echo W('Follow/followList',[$clue_follow,$customer,'customer']);?>

								</div>

							</div>

							<script>

								$(function(){

									$('#follow-entry').click(function(){

										$('.follow-default').addClass('hidden');

										$('.follow-tocreate').show();

									})
								})

								function switchFollowContent(obj,i)
								{
									$(obj).siblings().removeClass('active');

									$(obj).parent().siblings('.followContent').hide();

									$(obj).addClass('active');

									$('#followContent'+i).show();
								}

							</script>

							<script type="text/javascript">

								$(function()
								{
									layui.use(['layedit','form'], function()
									{
										var layedit = layui.layedit;

										var commentEditor = layedit.build('commentEditor',{hideTool:['strong','italic','underline','del','|','left','center','right','link','unlink','image','help'], height:120});

										$('.reply-comment,.comment-close').on('click',function()
										{
											$("#comment,.comment-shade").fadeToggle();

											var value = $(this).data('value');

											if(value != undefined)
											{
												$('#commentFollowId').val(value);
											}

											$('.submit-comment a').unbind('click').on('click',function()
											{
												layedit.sync(commentEditor);

												layer.load(2,{offset:['150px']});

												$.post("<?php echo U('commentFollow');?>",$('#commentForm').serialize(),function(data)
												{
													if(data.errcode == 0)
													{
														layer.msg(data.msg,{icon:1,time:1000,offset:['150px']},function()
														{
															window.location.reload();
														});
													}
													else
													{
														layer.closeAll('loading');

														layer.msg(data.msg,{icon:2,time:1500,offset:['150px']});
													}
												},'JSON')
											})
										})
									});

									$('.comment-more').on('click',function()
									{
										$(this).siblings('.comment-item:gt(2)').slideToggle('fast');

										$(this).find('i').toggleClass('icon-upward');
									});
								})

							</script>

						</div><?php endif; ?>

					<?php if($isFollowAuthView || $isContractAuthView): ?><div class="customerDetailContent hidden" id="customer-detail-content9">

							<div class="feelcrm-follow-nav" >

								<div class="follow-nav-list active" onclick="switchFollowContent(this,11)"><?php echo L('WHOLE');?></div>

								<?php if(!empty($isFollowAuthView)): ?><div class="follow-nav-list" onclick="switchFollowContent(this,22)"><?php echo L('CUSTOMER');?></div>
									<div class="follow-nav-list" onclick="switchFollowContent(this,33)"><?php echo L('OPPORTUNITY');?></div>
									<div class="follow-nav-list" onclick="switchFollowContent(this,44)"><?php echo L('CLUE');?></div><?php endif; ?>

								<?php if(!empty($isContractAuthView)): ?><div class="follow-nav-list" onclick="switchFollowContent(this,55)"><?php echo L('CONTRACT');?></div><?php endif; ?>

								<div class="clear"></div>

							</div>

							<div class="feelcrm-follow border-none followContent" id="followContent11">

								<?php echo W('Follow/fileList',[$files]);?>

							</div>

							<?php if(!empty($isFollowAuthView)): ?><div class="feelcrm-follow border-none followContent hidden" id="followContent22">

									<?php echo W('Follow/fileList',[$file_customer]);?>

								</div>

								<div class="feelcrm-follow border-none followContent hidden" id="followContent33">

									<?php echo W('Follow/fileList',[$file_opportunity]);?>

								</div>

								<div class="feelcrm-follow border-none followContent hidden" id="followContent44">

									<?php echo W('Follow/fileList',[$file_clue]);?>

								</div><?php endif; ?>

							<?php if(!empty($isContractAuthView)): ?><div class="feelcrm-follow border-none followContent hidden" id="followContent55">

									<?php echo W('Follow/fileList',[$file_contract]);?>

								</div><?php endif; ?>

						</div><?php endif; ?>

					<!--<?php echo L('OPERATION_RECORD');?>-->
					<div class="customerDetailContent <?php if(!empty($isFollowAuthView)): ?>hidden<?php endif; if(($detailtype) != "index"): ?>hidden<?php endif; ?>" id="customer-detail-content4">

						<?php if(!empty($abandon_log)): ?><!--<div class="customer-detail-title" >

								<span><?php echo L('GIVE_UP_CUSTOMERS');?></span>

							</div>-->

							<div class="item-list wd100 pl0 pr0 border_b">

								<table class="layui-table mar0" lay-skin="line">

									<thead>

									<tr>

										<th class="common_con_th"><?php echo L('REASON_FOR_GIVING_UP');?></th><th><?php echo L('CUSTOMER_HANDLER');?></th><th><?php echo L('OPERATOR');?></th><th><?php echo L('TIME');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(is_array($abandon_log)): $i = 0; $__LIST__ = $abandon_log;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td class="common_con_td" title="<?php echo ($vo["abandon_name"]); ?>"><?php echo ($vo["abandon_name"]); ?></td>

											<td><?php echo ($vo["member_name"]); ?></td>

											<td><?php echo ($vo["operator_name"]); ?></td>

											<td><?php echo (getDates($vo["createtime"])); ?></td>
										</tr><?php endforeach; endif; else: echo "" ;endif; ?>

									</tbody>

								</table>

							</div><?php endif; ?>

						<?php if(!empty($lose_log)): ?><!--<div class="customer-detail-title pd0" ><span><?php echo L('CUSTOMER_LOST_ORDER');?></span></div>-->

							<div class="item-list wd100 pl0 pr0 mt15 border_b">

								<table class="layui-table mar0" lay-skin="line">

									<thead>

									<tr>

										<th class="common_con_th"><?php echo L('REASON_FOR_LOSS');?></th><th class="common_con_th"><?php echo L('COMPETITOR');?></th><th><?php echo L('OPPORTUNITY_NAME');?></th><th><?php echo L('OPERATOR');?></th><th><?php echo L('TIME');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(is_array($lose_log)): $i = 0; $__LIST__ = $lose_log;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td class="common_con_td" title="<?php echo ($vo["lose_name"]); ?>"><?php echo ($vo["lose_name"]); ?></td>

											<td class="common_con_td" title="<?php echo ($vo["competitor_name"]); ?>"><?php echo ($vo["competitor_name"]); ?></td>

											<td><?php echo ((isset($vo["opportunity_name"]) && ($vo["opportunity_name"] !== ""))?($vo["opportunity_name"]):'<span class="iconfont icon-nothing"></span>'); ?></td>

											<td><?php echo ($vo["operator_name"]); ?></td>

											<td><?php echo (getDates($vo["createtime"])); ?></td>
										</tr><?php endforeach; endif; else: echo "" ;endif; ?>

									</tbody>

								</table>

							</div><?php endif; ?>

						<div class="operate-info" id="CrmLogBox">


						</div>

						<script>

							layui.use('flow', function()
							{
								var flow = layui.flow;

								flow.load(
								{
									elem: '#CrmLogBox',
									scrollElem:'.feeldesk-main',
									isAuto:false,
									done: function(page, next)
									{
										var url = "<?php echo (ACTION_NAME); ?>";

										var customer_id = "<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>";

										var detailtype = "<?php echo encrypt($detailtype,'CUSTOMER');?>";

										var lis = [];

										$.get("<?php echo U('customer/'.ACTION_NAME);?>?id="+customer_id+"&detailtype="+detailtype+"&p="+page+"&request=crmlog", function(data)
										{
											if(data.data)
											{
												if (data.data.length > 0) {
													layui.each(data.data, function (index, item) {
														var items = '<div class="operate-list">';

														if (item.member.face) {
															items += '<img src="' + item.member.face + '" alt="">';
														} else {
															items += '<img src="/Attachs/face/face.png" alt="">';
														}
														items += '&nbsp;&nbsp;&nbsp;<span class="blue8">' + item.member.name + '</span>';

														items += '<span class="gray9 fts12">&nbsp;• ' + item.createtime + '&nbsp;</span>';

														items += '<span>' + item.content + '</span>';

														items += '</div>';

														lis.push(items);
													});

													next(lis.join(''), page < data.pages);
												} else {
													var items = "";

													lis.push(items);

													next(lis.join(''), page < data.pages);
												}
											}
										});

									}
								});
							});

						</script>

					</div>

					<!--<?php echo L('CLIENT_ANALYSIS');?>-->
					<!--<div class="customerDetailContent <?php if(($detailtype) != "analysis"): ?>hidden<?php endif; ?>" id="customer-detail-content5">

						<div class="form-item pb25 pt10">

							<div class="wd100"></div>

							<form class="layui-form" action="<?php echo U('customer/edit_analysis',['id'=>encrypt($analysis['analysis_id'],'CUSTOMER'),'customer_id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('analysis','CUSTOMER'),'detail_source'=>$detail_source]);?>">

								<a href="javascript:" class="feelcrm-commbtn fr edit-customer-detail" ><?php echo L('EDITOR');?></a>

								<a href="javascript:" class="feelcrm-commbtn fr finish-customer-detail" ><?php echo L('COMPLETE');?></a>

								<div class="clear"></div>

								<?php if(is_array($analysisform)): $i = 0; $__LIST__ = $analysisform;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="layui-form-item mb10 wd50 fl">

										<label class="layui-form-label"><?php echo ($vo["form_description"]); ?></label>

										<div class="layui-input-inline <?php if(!empty($isEditAnalysisAuth)): ?>pd0 detail-update-form<?php endif; ?>">

											<div class="layui-detail-edit-default" >

												<?php echo ((isset($analysis['detail'][$vo['form_name']]) && ($analysis['detail'][$vo['form_name']] !== ""))?($analysis['detail'][$vo['form_name']]):'&#45;&#45;'); ?>

											</div>

											<?php if(!empty($isEditAnalysisAuth)): ?><div class="hidden layui-detail-edit-form">

													<?php if(($vo["form_type"]) == "date"): $ft++; endif; ?>

													<?php if(($vo["form_type"]) == "region"): $reg++; endif; ?>

													<?php $t++; ?>

													<?php echo W('Update/updateFormContent',[$analysis,$analysis['analysis_id'],$vo,'analysis',$t,$ft,$reg]);?>

												</div>

												<i class="i-update-success iconfont icon-system-success hidden"></i><?php endif; ?>

										</div>

										<div class="clear"></div>

									</div><?php endforeach; endif; else: echo "" ;endif; ?>

								<?php if(is_array($analysisform2)): $i = 0; $__LIST__ = $analysisform2;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="layui-form-item mb10 wd100 layui-form-item-textarea fl">

										<label class="layui-form-label">

											<?php echo ($vo["form_description"]); ?>

										</label>

										<div class="layui-input-inline <?php if(!empty($isEditAnalysisAuth)): ?>pd0 detail-update-form<?php endif; ?>">

											<div class="layui-detail-edit-default textareaImg">

												<?php echo ((isset($analysis['detail'][$vo['form_name']]) && ($analysis['detail'][$vo['form_name']] !== ""))?($analysis['detail'][$vo['form_name']]):'&#45;&#45;'); ?>

											</div>

											<?php if(!empty($isEditAnalysisAuth)): $tx++; ?>

												<div class="hidden layui-detail-edit-form">

													<textarea class="layui-textarea layui-hide ticket-textarea" name="analysis_form[<?php echo ($vo["form_name"]); ?>]" id="crmEditor<?php echo $tx; ?>"><?php echo ($analysis['detail'][$vo['form_name']]); ?></textarea>

												</div>

												<i class="i-update-success iconfont icon-system-success hidden"></i>

												<script>

													layui.use(['layedit'],function()
													{
														var layedit = layui.layedit;

														crmEditor<?php echo ($tx); ?> = layedit.build('crmEditor<?php echo ($tx); ?>',{uploadImage: {url:"/"+moduleName+"/Upload/uploadImageFile?type=editor", type: 'post'},hideTool:['face'],height:200});

														$('.submit-textarea').click(function()
														{
															var content = layedit.getContent(crmEditor<?php echo ($tx); ?>);

															updateFormContentAjax('<?php echo U("AjaxRequest/updateFormContent");?>','<?php echo ($analysis["analysis_id"]); ?>','analysis',content,'<?php echo ($vo["form_name"]); ?>',$('textarea[name="analysis_form[<?php echo ($vo["form_name"]); ?>]"]'),'textarea');
														})

													})

												</script><?php endif; ?>

										</div>

										<div class="clear"></div>

									</div><?php endforeach; endif; else: echo "" ;endif; ?>


								<div class="clear"></div>

							</form>

						</div>

					</div>-->

					<!--<?php echo L('COMPETITOR');?>-->
					<!--<div class="customerDetailContent hidden" id="customer-detail-content6">

						<div class="pt20 pb15" >

							<?php echo FEELCRM('Customer/create_competitor',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('index','CUSTOMER')],L('ADD_COMPETITOR'),'feelcrm-commbtn');?>

						</div>

						<div class="item-list wd100 pl0 pr0 border_t">

							<table class="layui-table mar0" lay-skin="line">

								<thead>

								<tr>

									<th><?php echo L('COMPETITOR_NAME');?></th><th><?php echo L('OPPOSING_STAGE');?></th><th class="follow_con_th"><?php echo L('ADVANTAGE');?></th><th class="follow_con_th"><?php echo L('DISADVANTAGE');?></th><th><?php echo L('OPERATION');?></th>

								</tr>

								</thead>

								<tbody>
								<?php if(empty($competitor)): ?><tr class="nodata center">

										<td colspan="11">

											<p><i class="iconfont icon-nothing fts20"></i></p>

											<p><?php echo L('NO_DATA');?></p>

										</td>

									</tr>

									<?php else: ?>

									<?php if(is_array($competitor)): $i = 0; $__LIST__ = $competitor;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td><?php echo ($vo["detail"]["name"]); ?></td>

											<td><?php echo ($vo["detail"]["stage"]); ?></td>

											<td class="follow_con_td" title="<?php echo ($vo["detail"]["advantage"]); ?>"><?php echo ($vo["detail"]["advantage"]); ?></td>

											<td class="follow_con_td" title="<?php echo ($vo["detail"]["inferiority"]); ?>"><?php echo ($vo["detail"]["inferiority"]); ?></td>

											<td class="listOperate">

												<i class="iconfont icon-dian"></i>

												<div class="operate hidden">

													<?php echo FEELCRM('Customer/edit_competitor',['id'=>encrypt($vo['competitor_id'],'CUSTOMER'),'customer_id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('index','CUSTOMER'),'detail_source'=>$detail_source],L('EDITOR'));?>

													<?php echo FEELCRM('Customer/delete_competitor',['id'=>encrypt($vo['competitor_id'],'CUSTOMER'),'detailtype'=>encrypt('index','CUSTOMER')],L('DELETE'),'','async');?>

												</div>

											</td>

										</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

								</tbody>

							</table>

							<div class="mt20">


							</div>

						</div>

					</div>-->

					<?php else: ?>

					<!--<?php echo L('OPERATION_RECORD');?>-->
					<div class="customerDetailContent" id="customer-detail-content4">


						<!--<div class="form-item pb25 pt20 ">

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('SUBORDINATE_SECTOR');?>

								</label>

								<div class="layui-input-inline">

									<?php echo CrmgetMemberGroupName($groupList,$customer['group_id']);?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('LAST_FOLLOW-UP_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($customer["lastfollowtime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('CUSTOMER_RESPONSIBLE');?>

								</label>

								<div class="layui-input-inline blue6">

									<?php echo ($customer["member_name"]); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('NEXT_CONTACT_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($customer["nextcontacttime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('IS_LOSE_ORDER');?>

								</label>

								<div class="layui-input-inline">

									<?php if(($customer["is_losed"]) == "1"): ?><span class="red1"><?php echo L('YES');?></span>

										<?php else: ?>

										<span class="green4"><?php echo L('NO');?></span><?php endif; ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('FOUNDER');?>

								</label>

								<div class="layui-input-inline">
									<?php echo getCustomerCreateName($customer['creater_id'],$customer['creater_name']);?>
								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('CREATE_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($customer["createtime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="clear"></div>

						</div>-->

						<?php if(!empty($abandon_log)): ?><!--<div class="customer-detail-title" >

								<span><?php echo L('GIVE_UP_CUSTOMERS');?></span>

							</div>-->

							<div class="item-list wd100 pl0 pr0 border_b">

								<table class="layui-table mar0" lay-skin="line">

									<thead>

									<tr>

										<th class="common_con_th"><?php echo L('REASON_FOR_GIVING_UP');?></th><th><?php echo L('CUSTOMER_HANDLER');?></th><th><?php echo L('OPERATOR');?></th><th><?php echo L('TIME');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(is_array($abandon_log)): $i = 0; $__LIST__ = $abandon_log;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td class="common_con_td" title="<?php echo ($vo["abandon_name"]); ?>"><?php echo ($vo["abandon_name"]); ?></td>

											<td><?php echo ($vo["member_name"]); ?></td>

											<td><?php echo ($vo["operator_name"]); ?></td>

											<td><?php echo (getDates($vo["createtime"])); ?></td>
										</tr><?php endforeach; endif; else: echo "" ;endif; ?>

									</tbody>

								</table>

							</div><?php endif; ?>

						<?php if(!empty($lose_log)): ?><!--<div class="customer-detail-title pd0" ><span><?php echo L('CUSTOMER_LOST_ORDER');?></span></div>-->

							<div class="item-list wd100 pl0 pr0 mt15 border_b">

								<table class="layui-table mar0" lay-skin="line">

									<thead>

									<tr>

										<th class="common_con_th"><?php echo L('REASON_FOR_LOSS');?></th><th class="common_con_th"><?php echo L('COMPETITOR');?></th><th><?php echo L('OPPORTUNITY_NAME');?></th><th><?php echo L('OPERATOR');?></th><th><?php echo L('TIME');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(is_array($lose_log)): $i = 0; $__LIST__ = $lose_log;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td class="common_con_td" title="<?php echo ($vo["lose_name"]); ?>"><?php echo ($vo["lose_name"]); ?></td>

											<td class="common_con_td" title="<?php echo ($vo["competitor_name"]); ?>"><?php echo ($vo["competitor_name"]); ?></td>

											<td><?php echo ((isset($vo["opportunity_name"]) && ($vo["opportunity_name"] !== ""))?($vo["opportunity_name"]):'<span class="iconfont icon-nothing"></span>'); ?></td>

											<td><?php echo ($vo["operator_name"]); ?></td>

											<td><?php echo (getDates($vo["createtime"])); ?></td>
										</tr><?php endforeach; endif; else: echo "" ;endif; ?>

									</tbody>

								</table>

							</div><?php endif; ?>

						<div class="operate-info" id="CrmLogBox">


						</div>

						<script>

							layui.use('flow', function()
							{
								var flow = layui.flow;

								flow.load(
										{
											elem: '#CrmLogBox',
											scrollElem:'.feeldesk-main',
											isAuto:false,
											done: function(page, next)
											{
												var url = "<?php echo (ACTION_NAME); ?>";

												var customer_id = "<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>";

												var detailtype = "<?php echo encrypt($detailtype,'CUSTOMER');?>";

												var lis = [];

												$.get("<?php echo U('customer/'.ACTION_NAME);?>?id="+customer_id+"&detailtype="+detailtype+"&p="+page+"&request=crmlog", function(data)
												{
													if(data.data.length > 0)
													{
														layui.each(data.data, function(index, item)
														{
															var items ='<div class="operate-list">';

															if(item.member.face)
															{
																items += '<img src="' + item.member.face + '" alt="">';
															}
															else
															{
																items += '<img src="/Attachs/face/face.png" alt="">';
															}
															items += '&nbsp;&nbsp;&nbsp;<span class="blue8">'+item.member.name+'</span>';

															items += '<span class="gray9 fts12">&nbsp;• '+item.createtime+'&nbsp;</span>';

															items += '<span>'+item.content+'</span>';

															items += '</div>';

															lis.push(items);
														});

														next(lis.join(''), page < data.pages);
													}
													else
													{
														var items = "";

														lis.push(items);

														next(lis.join(''), page < data.pages);
													}
												});

											}
										});
							});

						</script>

					</div><?php endif; ?>
			</div>

			<!--</form>-->

			<?php if(($customer["isvalid"]) == "1"): ?><!-- <?php echo L('CONTACT');?> -->
				<div class="form-content form-content3 <?php if(($detailtype) != "contacter"): ?>hidden<?php endif; ?>">

					<div class="item-list feelcrm-list wd100 pl0 pr0">

						<table class="layui-table" lay-skin="line">

							<thead>

							<tr>

								<!--<th><?php echo L('CONTACT_NAME');?></th><th><?php echo L('TEL');?></th><th><?php echo L('MAILBOX');?></th><th><?php echo L('CHARACTER');?></th><th><?php echo L('HONORIFIC');?></th>-->

								<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
									<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><th><?php echo ($vo["form_description"]); ?></th><?php endif; endforeach; endif; else: echo "" ;endif; ?>

								<th><?php echo L('OPERATION');?></th>

							</tr>

							</thead>

							<tbody>

							<?php if(empty($contacter)): ?><tr class="nodata center">

									<td colspan="11">

										<p><i class="iconfont icon-nothing fts20"></i></p>

										<p><?php echo L('NO_DATA');?></p>

									</td>

								</tr>

								<?php else: ?>

								<?php if(is_array($contacter)): $i = 0; $__LIST__ = $contacter;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

										<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
											<?php if(!$v['role_id'] || in_array($index['role_id'],explode(',',$v['role_id']))): ?><td <?php if(($v["form_type"]) == "textarea"): ?>title="<?php echo (strip_tags($vo['detail'][$v['form_name']])); ?>"<?php endif; ?>>

											<?php if(($v["form_type"]) == "textarea"): echo mb_substr(strip_tags($vo['detail'][$v['form_name']]),0,20);?>...<?php else: echo ($vo['detail'][$v['form_name']]); endif; ?>

											<?php if(($v["form_name"]) == "name"): if(($vo["contacter_id"]) == $customer["first_contact_id"]): ?><span class="orange5">(<?php echo L('PRIMARY');?>)</span><?php endif; endif; ?>

											<?php if($v['form_name'] == 'phone' && $customer['detail'][$v['form_name']]): ?><span class="icon-onclickcall" style="margin-left: 5px !important;"><i class="iconfont icon-boda blue8" onclick="CallUp(<?php echo ($customer['detail'][$v['form_name']]); ?>,4);"></i></span><?php endif; ?>

											</td><?php endif; endforeach; endif; else: echo "" ;endif; ?>

										<td class="listOperate">

											<i class="iconfont icon-dian"></i>

											<div class="operate hidden">

												<?php echo FEELCRM('Customer/edit_contacter',['id'=>encrypt($vo['contacter_id'],'CONTACTER'),'detailtype'=>encrypt('contacter','CUSTOMER')],L('EDITOR'));?>

												<?php echo FEELCRM('Customer/delete_contacter',['id'=>encrypt($vo['contacter_id'],'CONTACTER'),'detailtype'=>encrypt('contacter','CUSTOMER')],L('DELETE'),'','async');?>

												<?php if(($vo["contacter_id"]) != $customer["first_contact_id"]): echo FEELCRM('Customer/setFirst_contacter',['id'=>encrypt($vo['contacter_id'],'CONTACTER'),'detailtype'=>encrypt('contacter','CUSTOMER')],L('SET_PRIMARY_CONTACT'),'','async'); endif; ?>

											</div>

										</td>

									</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

							</tbody>

						</table>

						<div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($page); ?></div></div>

					</div>

				</div>

				<!-- 商机 -->
				<div class="form-content form-content3 <?php if(($detailtype) != "opportunity"): ?>hidden<?php endif; ?>">

					<div class="item-list feelcrm-list wd100 pl0 pr0">

						<table class="layui-table" lay-skin="line">

							<thead>

							<tr>

								<th><?php echo L('OPPORTUNITY_NO');?></th>

								<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
									<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><th><?php echo ($vo["form_description"]); ?></th><?php endif; endforeach; endif; else: echo "" ;endif; ?>

								<th><?php echo L('LEADER');?></th>

								<th><?php echo L('CREATE_TIME');?></th>

								<th><?php echo L('FOUNDER');?></th>

							</tr>

							</thead>

							<tbody>

							<?php if(empty($opportunity)): ?><tr class="nodata center">

									<td colspan="11">

										<p><i class="iconfont icon-nothing fts20"></i></p>

										<p><?php echo L('NO_DATA');?></p>

									</td>

								</tr>

								<?php else: ?>

								<?php if(is_array($opportunity)): $i = 0; $__LIST__ = $opportunity;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr data-id="<?php echo (encrypt($vo["opportunity_id"],'OPPORTUNITY')); ?>" data-type="detailPop">

										<td onclick="clickOpenDetail(this,'opportunity')" ><?php echo ($vo["opportunity_prefix"]); echo ($vo["opportunity_no"]); ?></td>

										<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
											<?php if(!$v['role_id'] || in_array($index['role_id'],explode(',',$v['role_id']))): ?><td <?php if(($v["form_type"]) == "textarea"): ?>title="<?php echo (strip_tags($vo['detail'][$v['form_name']])); ?>"<?php endif; ?>>

											<?php if(($v["form_type"]) == "textarea"): echo mb_substr(strip_tags($vo['detail'][$v['form_name']]),0,20);?>...<?php else: echo ($vo['detail'][$v['form_name']]); endif; ?>

											<?php if(($v["form_name"]) == "name"): if(($vo["contacter_id"]) == $customer["first_contact_id"]): ?><span class="orange5">(<?php echo L('PRIMARY');?>)</span><?php endif; endif; ?>

											</td><?php endif; endforeach; endif; else: echo "" ;endif; ?>

										<td onclick="clickOpenDetail(this,'opportunity')"><?php echo ($vo["member_name"]); ?></td>

										<td onclick="clickOpenDetail(this,'opportunity')"><?php echo (getDates($vo["createtime"])); ?></td>

										<td onclick="clickOpenDetail(this,'opportunity')"><?php echo ($vo["create_name"]); ?></td>

									</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

							</tbody>

						</table>

						<div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($page); ?></div></div>

					</div>

				</div>

				<div class="form-content form-content4 <?php if(($detailtype) != "contract"): ?>hidden<?php endif; ?>"> <!--<?php echo L('CONTRACT');?>-->

					<div class="item-list feelcrm-list layui-form wd100">

						<table class="layui-table" lay-skin="line">

							<thead>

							<tr>

								<th><?php echo L('CONTRACT_NO');?></th>

								<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
									<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><th><?php echo ($vo["form_description"]); ?></th><?php endif; endforeach; endif; else: echo "" ;endif; ?>

								<th><?php echo L('LEADER');?></th>

								<th><?php echo L('CREATE_TIME');?></th><!--<th><?php echo L('OPERATION');?></th>-->

							</tr>

							</thead>

							<tbody>

							<?php if(empty($contract)): ?><tr class="nodata center">

									<td colspan="11">

										<p><i class="iconfont icon-nothing fts20"></i></p>

										<p><?php echo L('NO_DATA');?></p>

									</td>

								</tr>

								<?php else: ?>

								<?php if(is_array($contract)): $i = 0; $__LIST__ = $contract;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr data-id="<?php echo (encrypt($vo["contract_id"],'CONTRACT')); ?>" data-type="detailPop">

										<td mini='contract'><?php echo ($vo["contract_prefix"]); echo ($vo["contract_no"]); ?></td>

										<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
											<?php if(!$v['role_id'] || in_array($index['role_id'],explode(',',$v['role_id']))): ?><td mini='contract' <?php if(($v["form_type"]) == "textarea"): ?>title="<?php echo (strip_tags($vo['detail'][$v['form_name']])); ?>"<?php endif; ?> <?php if(($v["form_name"]) == "price"): ?>class="red"<?php endif; ?>><?php if(($v["form_type"]) == "textarea"): echo mb_substr(strip_tags($vo['detail'][$v['form_name']]),0,20);?>...<?php else: echo ($vo['detail'][$v['form_name']]); endif; ?></td><?php endif; endforeach; endif; else: echo "" ;endif; ?>

										<td mini='contract'><?php echo ($vo["member_name"]); ?></td>

										<td mini='contract' >

											<?php echo (date("Y-m-d H:i:s",$vo["createtime"])); ?>

										</td>

										<!--<td class="listOperate">

											<i class="iconfont icon-dian"></i>

											<div class="operate hidden">

												<?php echo FEELCRM('contract/ticketTemplate',['id'=>encrypt($vo['contract_id'],'CONTRACT')],L('CREATE_TICKET'));?>

											</div>

										</td>-->

									</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

							</tbody>

						</table>

						<div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($page); ?></div></div>

					</div>

				</div>

				<?php if(($crmsite["customerReseller"]) == "1"): ?><div class="form-content form-content5 <?php if(($detailtype) != "shipment"): ?>hidden<?php endif; ?>"> <!--<?php echo L('CONTRACT');?>-->

						<div class="item-list feelcrm-list layui-form wd100">

							<div class="form-nav" id="shipmentNav">

								<ul>

									<li><a href="javascript:void(0);" class="active" onclick="switchShipment(this,1)"><?php echo L('IN_STOCK');?></a></li>

									<li><a href="javascript:void(0);" onclick="switchShipment(this,2)"><?php echo L('SHIPMENT');?></a></li>

								</ul>

							</div>

							<div class="shipmentBox" id="shipmentBox1">

								<table class="layui-table" lay-skin="line">

									<thead>

									<tr>

										<th><?php echo L('PRODUCT_NUMBER');?></th>

										<th><?php echo L('TOTAL_NUMBER_OF_PRODUCTS');?></th>

										<th><?php echo L('EXPORT_QUANTITY');?></th>

										<th><?php echo L('IN_STOCK');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(is_array($productStock)): $i = 0; $__LIST__ = $productStock;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td><?php echo ($vo["product_name"]); ?></td>

											<td><?php echo ($vo["num"]); ?></td>

											<td><?php echo ($vo["shipment_num"]); ?></td>

											<td><?php echo ($vo["surplus_num"]); ?></td>

										</tr><?php endforeach; endif; else: echo "" ;endif; ?>

									</tbody>

								</table>

							</div>

							<div class="shipmentBox hidden" id="shipmentBox2">

								<div class="pt20">

									<?php echo FEELCRM('shipment/create',['id'=>encrypt($customer['customer_id'],'CUSTOMER'),'detailtype'=>encrypt('shipment','CUSTOMER')],L('ADD_SHIPPING_INFORMATION'),'feelcrm-commbtn');?>

								</div>

								<table class="layui-table" lay-skin="line">

									<thead>

									<tr>

										<th><?php echo L('DELIVERY_TIME');?></th>

										<th><?php echo L('PRODUCT_NUMBER');?></th>

										<th><?php echo L('EXPORT_QUANTITY');?></th>

										<th><?php echo L('TOTAL_SHIPMENT_AMOUNT');?></th>

										<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
											<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><th><?php echo ($vo["form_description"]); ?></th><?php endif; endforeach; endif; else: echo "" ;endif; ?>

										<th><?php echo L('OPERATION');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(empty($shipment)): ?><tr class="nodata center">

											<td colspan="11">

												<p><i class="iconfont icon-nothing fts20"></i></p>

												<p><?php echo L('NO_DATA');?></p>

											</td>

										</tr>

										<?php else: ?>

										<?php if(is_array($shipment)): $i = 0; $__LIST__ = $shipment;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr >

												<td ><?php echo (date("Y-m-d H:i:s",$vo["createtime"])); ?></td>

												<td ><?php echo ($vo["product"]["name"]); ?></td>

												<td ><?php echo ($vo["num"]); ?></td>

												<td ><?php echo ($vo["money"]); ?></td>

												<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
													<?php if(!$v['role_id'] || in_array($index['role_id'],explode(',',$v['role_id']))): ?><td <?php if(($v["form_type"]) == "textarea"): ?>title="<?php echo (strip_tags($vo['detail'][$v['form_name']])); ?>"<?php endif; ?> <?php if(($v["form_name"]) == "price"): ?>class="red"<?php endif; ?>><?php if(($v["form_type"]) == "textarea"): echo mb_substr(strip_tags($vo['detail'][$v['form_name']]),0,20);?>...<?php else: echo ($vo['detail'][$v['form_name']]); endif; ?></td><?php endif; endforeach; endif; else: echo "" ;endif; ?>



												<td class="listOperate">

													<i class="iconfont icon-dian"></i>

													<div class="operate hidden">

														<?php echo FEELCRM('shipment/edit',['id'=>encrypt($vo['shipment_id'],'SHIPMENT'),'detailtype'=>encrypt('shipment','SHIPMENT')],L('EDITOR'));?>

														<?php echo FEELCRM('shipment/delete',['id'=>encrypt($vo['shipment_id'],'SHIPMENT'),'detailtype'=>encrypt('shipment','SHIPMENT')],L('DELETE'),'','async');?>

													</div>

												</td>

											</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

									</tbody>

								</table>

								<div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($page); ?></div></div>

							</div>

							<script>

								function switchShipment(obj,i)
								{
									$('#shipmentNav li a').removeClass('active');

									$(obj).addClass('active');

									$('.shipmentBox').hide();

									$('#shipmentBox'+i).show();
								}

							</script>

						</div>

					</div><?php endif; endif; ?>

	</div>

	</div>

	<script type="text/javascript">

		$('body').find('#closeCustomerDetail').click(function()
		{
			window.parent.postMessage('closeDetail','*');
		});

		window.addEventListener('message', function(e)
		{
			if(e.data)
			{
				window.formCustomer = 1;
			}
		}, false)

		$(function(){

			var Awidth = $('#detail-nav').width();

			var linum = $('#detail-nav ul').children("li").length;

			var liwidth = 130 * linum;

			if(Awidth > liwidth)
			{
				$('#detail-nav ul').css('min-width',Awidth+'px');
			}
			else
			{
				$('#detail-nav ul').css('min-width',liwidth+'px');
			}

			var Cwidth = $('#customer-detail-nav').width();

			var Clinum = $('#customer-detail-nav ul').children("li").length;

			var Cliwidth = 130 * Clinum;

			if(Cwidth > Cliwidth)
			{
				$('#customer-detail-nav ul').css('min-width',Cwidth+'px');
			}
			else
			{
				$('#customer-detail-nav ul').css('min-width',Cliwidth+'px');
			}
		})

	</script>

	<script type="text/javascript" src="/Public/js/submitform.js"></script>
<script type="text/javascript">
	
	layui.use('form',function()
	{
		var form = layui.form;
		
		form.render('checkbox');
		
		form.render('radio');
		
		form.render('select');

	})
	
</script>



    </div>

    <script type="text/javascript">

        layer.ready(function()
        {
            layer.photos({
                photos: '.textareaImg',
                shift: 5,
                shade: [0.8, 'rgba(0,0,0,.8)']
            });

        })

    </script>

    <script>

        //客户端
        /*if ( navigator.userAgent.toLowerCase().indexOf('electron/') > -1)
        {
            top.setIframe(document);
        }*/
    </script>

    </body>

</html>